import { getInfo, setInfo } from '@/utils/storage';
export default {
	namespaced: true,
	state: {
		userInfo: getInfo()
	},
	mutations: {
		setUserInfo(state, userInfo) {
			state.userInfo = userInfo;
			setInfo(userInfo);
		}
	},
	actions: {
		// 登出
		logout(context) {
			context.commit('setUSerInfo', {});
			// context.commit('cart/setCartList', [], { root: true });
		}
	}
};
